import MenuView from "@/layouts/MenuView";
import PageView from "@/layouts/PageView";
// import RouteView from '@/layouts/RouteView'
import Login from "@/views/login";
import Home from "@/views/home";
import Test from "@/views/test";

const routes = [
  {
    path: "/home",
    component: Home,
    name: "幻熊科技",
    icon: "home",
    invisible: true
  }
];

const constantRouterMap = [
  {
    path: "/",
    name: "首页",
    redirect: "幻熊科技",
    component: MenuView,
    children: routes
  },
  {
    path: "/login",
    name: "登录页",
    component: Login,
    invisible: true
  },
  {
    path: "*",
    redirect: { name: "幻熊科技" }
  }
];

const isDev = process.env.NODE_ENV === "development";

if (isDev) {
  constantRouterMap[0].children.push({
    path: "/test",
    redirect: "/test/test",
    component: PageView,
    name: "测试页面",
    icon: "fire",
    invisible: true,
    children: [
      {
        path: "/test/test",
        icon: "none",
        invisible: true,
        name: "测试",
        component: Test
      }
    ]
  });
}

export default constantRouterMap;
